package com.foreknow.demo02;


import java.util.Scanner;
import java.util.jar.JarOutputStream;

public class HomeWork {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("输入消费的金额:");
        double money = input.nextDouble();
        if (50 <= money && money < 100){
            System.out.println("是否参加换购活动\n" +
                    "\n" +
                    "1、满50元，加2元钱换购A商品\n" +
                    "0、不换购");
            System.out.println("请选择：");
            int num = input.nextInt();
            switch(num){
                case 1 :
                    System.out.println("本次消费的总金额：" + (money+2) + "\n成功换购:A商品");
                    break;
                case 0 :
                    System.out.println("不换购 \n谢谢惠顾");
                    break;
                default:
                    System.out.println("");
                    break;
            }
        }else if(money >=100 && money <200){
            System.out.println("是否参加换购活动\n" +
                    "\n" +
                    "1、满50元，加2元钱换购A商品\n" +
                    "\n" +
                    "2、满100元，加3元钱换购B商品\n" +
                    "\n" +
                    "3、满100元，加10元钱换购C商品\n" +
                    "\n" +
                    "0、不换购");
            System.out.println("请选择：");
            int num = input.nextInt();
            switch(num){
                case 1 :
                    System.out.println("本次消费的总金额：" + (money+2) + "\n成功换购:A商品");
                    break;
                case 2 :
                    System.out.println("本次消费的总金额：" + (money+3) + "\n成功换购:B商品");
                    break;
                case 3 :
                    System.out.println("本次消费的总金额：" + (money+10) + "\n成功换购:C商品");
                    break;
                case 0 :
                    System.out.println("不换购 \n谢谢惠顾");
                    break;
                default:
                    System.out.println("");
                    break;
            }
        }else if(money >= 200){
                System.out.println("是否参加换购活动\n" +
                    "\n" +
                    "1、满50元，加2元钱换购A商品\n" +
                    "\n" +
                    "2、满100元，加3元钱换购B商品\n" +
                    "\n" +
                    "3、满100元，加10元钱换购C商品\n" +
                    "\n" +
                    "4、满200元，加10元钱换购D商品\n" +
                    "\n" +
                    "5、满200元，加20元钱换购E商品\n" +
                    "\n" +
                    "0、不换购");
            System.out.println("请选择：");
            int num = input.nextInt();
            switch(num){
                case 1 :
                    System.out.println("本次消费的总金额：" + (money+2) + "\n成功换购:A商品");
                    break;
                case 2 :
                    System.out.println("本次消费的总金额：" + (money+3) + "\n成功换购:B商品");
                    break;
                case 3 :
                    System.out.println("本次消费的总金额：" + (money+10) + "\n成功换购:C商品");
                    break;
                case 4 :
                    System.out.println("本次消费的总金额：" + (money+10) + "\n成功换购:D商品");
                    break;
                case 5 :
                    System.out.println("本次消费的总金额：" + (money+20) + "\n成功换购:E商品");
                    break;
                case 0 :
                    System.out.println("不换购 \n谢谢惠顾");
                    break;
                default:
                    System.out.println("");
                    break;
            }
        }else{
            System.out.println("谢谢惠顾");
        }

    }
}
